package com.ymxx.jweb.persistence.business;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

import com.ymxx.jweb.persistence.organization.Employee;

/**
 * @author Administrator
 * 贷款申请表
 */
@Entity
@Table(name="YMXX_LOAN_APPLY_BILL")
public class LoanApplyBill {

	
	public LoanApplyBill() {
		super();
	}

	@Id
	@Column(name="UUID",length=128)
	@GeneratedValue(generator="system-uuid")
	@GenericGenerator(name="system-uuid", strategy = "org.hibernate.id.UUIDGenerator")
	public String uuid;
	/**
	 * 贷款申请人姓名，不一定是系统用户
	 */
	@Column(name="APPLY_USER_NAME")
	public String applyUsername;
	/**
	 * 贷款金额
	 */
	@Column(name="AMOUNT")
	public Double amount;
	/**
	 * 贷款申请人身份证号
	 */
	@Column(name="PERSON_ID")
	public String personId;
	
	/**
	 * 申请时间 yyyy-MM-dd HH:mm:ss
	 */
	@Column(name="APPLY_DATE")
	@Temporal(TemporalType.TIMESTAMP)
	public Date applyDate;
	
	/**
	 * 贷款的用途说明
	 */
	@Column(name="USES",length=256)
	public String uses;
	
	/**
	 * 业务类型
	 */
	@ManyToOne(optional=false,fetch=FetchType.LAZY)
	@JoinColumn(name="BUSINESS_CODE")
	public BusinessType businessType;
	
	/**
	 * 经办人，一定是系统用户，（不能为空optional=false）
	 */
	@ManyToOne(fetch=FetchType.LAZY,optional=false)
	@JoinColumn(name="OPERATOR_UUID")
	public Employee operator;

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getApplyUsername() {
		return applyUsername;
	}

	public void setApplyUsername(String applyUsername) {
		this.applyUsername = applyUsername;
	}

	public Double getAmount() {
		return amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}

	public String getPersonId() {
		return personId;
	}

	public void setPersonId(String personId) {
		this.personId = personId;
	}

	public Date getApplyDate() {
		return applyDate;
	}

	public void setApplyDate(Date applyDate) {
		this.applyDate = applyDate;
	}

	public String getUses() {
		return uses;
	}

	public void setUses(String uses) {
		this.uses = uses;
	}

	public Employee getOperator() {
		return operator;
	}

	public void setOperator(Employee operator) {
		this.operator = operator;
	}
}
